<!DOCTYPE html>
            
<HTML>
<HEAD>
<meta name="booktitle" content="Developing Applications With Objective Caml" >
 <meta charset="ISO-8859-1"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<META name="GENERATOR" content="hevea 1.05-7 of 2000-02-24">
<META NAME="Author" CONTENT="Christian.Queinnec@lip6.fr">
<LINK rel=stylesheet type="text/css" href="videoc-ocda.css">
<script language="JavaScript" src="videoc.js"><!--
//--></script>
<TITLE>
 Using the Graphics Module
</TITLE>
</HEAD>
<BODY class="regularBody">
<A HREF="book-ora045.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="book-ora047.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2> Using the <TT>Graphics</TT> Module</H2>
Utilization of the library <TT>Graphics</TT> differs depending on the
system and the compilation mode used. We will not cover applications
other than usable under the interactive toplevel of Objective CAML. Under
the Windows and MacOS systems the interactive working environment
already preloads this library. To make it available under Unix, it
is necessary to create a new toplevel. This depends on the location
of the X11 library. If this library is placed in one of the usual
search paths for C language libraries, the command line is the
following:<A NAME="@fonctions146"></A>
<PRE>
ocamlmktop -custom -o mytoplevel graphics.cma -cclib -lX11
</PRE>It generates a new executable<TT>mytoplevel</TT> into which the library
<TT>Graphics</TT> is integrated. Starting the executable works as
follows:
<PRE>
./mytoplevel
</PRE>If, however, as under Linux, the library X11 is placed in another
directory, this has to be indicated to the command <TT>ocamlmktop</TT>:
<PRE>
ocamlmktop -custom -o mytoplevel graphics.cma -cclib \ 
           -L/usr/X11/lib -cclib -lX11
</PRE>In this example, the file <TT>libX11.a</TT> is searched in the directory
<TT>/usr/X11/lib</TT>.<BR>
<BR>
A complete description of the command <TT>ocamlmktop</TT> can be found in
chapter <A HREF="index.html#chap-Compilation">7</A>.<BR>
<BR>
<HR>
<A HREF="book-ora045.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="book-ora047.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
